package cn.yxsm.yxmall.controller;

import cn.yxsm.yxmall.mapper.OrderMapper;
import cn.yxsm.yxmall.pojo.dto.OrderDTO;
import cn.yxsm.yxmall.pojo.entity.OrderDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class OrderController {
    @Autowired(required = false)
    OrderMapper mapper;
    @RequestMapping("/order/selectYes")
    public List<OrderDetails> selectYes(){
        return mapper.selectYes();
    }
    @RequestMapping("/order/selectNo")
    public List<OrderDetails> selectNo(){
        return mapper.selectNo();
    }
    @RequestMapping("/order/addOrder")
    public void addOrder(@RequestBody OrderDTO order){
        /**
         * productId 商品id
         * num 数量
         */
        System.out.println("order = " + order);

    }
}
